import request from '@/utils/request'
import querystring from 'querystring'

/**
 * 分页查询流水账
 * @param {*} form 
 * @param {*} pageSize 
 * @param {*} currentPage 
 */
export function dataList(form, pageSize, currentPage) {
  const data = {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  }
  return request.post('/cost/page',data)
}
/**
 * 新增流水账
 * @param {*} options 
 */
export function addData(options) {
  return request.post('/cost/save', options)
}

/**
 * 修改流水账
 * @param {*} options 
 */
export function updateData(options) {
  return request.put('/cost/save', options)
}

/**
 * 获取流水账详情
 * @param {*} id 
 */
export function details(id) {
  return request.get(`/cost/findById/${id}`)
}

/**
 * 删除流水账
 * @param {*} id 
 */
export function deleteData(id) {
  return request.delete(`/cost/del/${id}`)
}


/**
 * 生成流水编号
 * @param {*} id 
 */
export function getCostCode() {
  return request.get(`/cost/getCostCode`)
}

